<template>
  <div>
    <swiper>
      <swiper-item v-for="item in banners" :key="item.acm">
        <a :href="item.link">
          <img :src="item.image" alt="" @load="imgLoad"/>
        </a>
      </swiper-item>
    </swiper>
  </div>
</template>

<script>
import {Swiper,SwiperItem} from '../../../components/swiper/index';

export default {
  name: "homeSwiper",
  props:{
    banners: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {
      isLoad: false
    }
  },
  components:{
    Swiper,
    SwiperItem
  },
  methods: {
    imgLoad() {
      if (!this.isLoad){
        this.$emit('swiperimgLoad');
        this.isLoad = true
      }
      
    }
  }
};
</script>

<style scoped>
</style>